import * as uuid from 'uuid/v4';
import {ReactElement, ReactNode} from 'react';

export default {
  generateId(prefix?: string) {
    return `${prefix || ''}${uuid().replace(/-/g, '')}`;
  },

  isReactElement(node: ReactNode): node is ReactElement<any> {
    return (node as ReactElement<any>).props !== undefined;
  }
};
